import React from 'react';

import { useIncrementCounter, useDecrementCounter, useCounter } from '../../state/counter/hooks';
import { useLogin } from '../../state/user/hooks';

import { Button } from 'antd';

type IProps = {

}

const Home: React.FC<IProps> = () => {
    const value = useCounter()

    const increment = useIncrementCounter()
    const decrement = useDecrementCounter()
    const login = useLogin()

    return (
        <div>
            value: {value}
            <button onClick={() => {
                increment()
            }}>add</button>
            <button onClick={() => {
                decrement()
            }}>del</button>
            <Button onClick={() => {
                login()
            }}>登录</Button>
        </div>
    )
}

export default Home